/**
 * @author:albert
 */

package com.bkbw.live.battle.business.ai;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import scala.collection.parallel.ParIterableLike.Count;

import com.badlogic.gdx.ai.btree.Task;
import com.badlogic.gdx.ai.msg.Telegram;

import com.bkbw.live.common.GameConfig;
import com.bkbw.live.battle.business.UnitObject;

public class BtSleep<EntityType extends UnitObject> extends BaseLeafNode<EntityType> {
	Logger logger = LoggerFactory.getLogger(GameConfig.LoggerName);
	int tick = 0;
	int sleepTime = 100;

	@Override
	public boolean handleMessage(Telegram arg0) {
		// TODO Auto-generated method stub
		return false;
	}
	
	@Override
	public void start() 
	{
		logger.debug("start sleep");
	}

	@Override
	public com.badlogic.gdx.ai.btree.Task.Status execute() {
		// TODO Auto-generated method stub
		if (tick < sleepTime) {
			tick++;
			return Status.RUNNING;
		}
		return Status.SUCCEEDED;
	}
	
	@Override
	public void end() 
	{
		logger.debug("wake up");
		tick = 0;
	}
	

	@Override
	protected Task<EntityType> copyTo(Task<EntityType> arg0) {
		// TODO Auto-generated method stub
		return null;
	}
}
